package com.young.common.util;


import com.young.common.exception.ParamException;

/**
 * 断言工具
 *
 * @author wangjy
 * @date 2021/10/16 23:54:58
 */
public class AssertUtil {

    public static void notBlank(String str, String message) {
        if (StringUtils.isBlank(str)) {
            throw new ParamException(message);
        }
    }

    public static void isBlank(String str, String message) {
        if (StringUtils.isNotBlank(str)) {
            throw new ParamException(message);
        }
    }

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new ParamException(message);
        }
    }

    public static void isNull(Object object, String message) {
        if (object != null) {
            throw new ParamException(message);
        }
    }

}
